<script setup>
import { reactive,ref } from 'vue';
const buttonStyle =ref({
    color:'yellow',
    backgroundColor:'purple'
})
const ispink=ref(false)
function mouseClick(){
console.log('别眨眼注意我的颜色')
if(ispink.value){
buttonStyle.value.backgroundColor='pink'
}else{
    buttonStyle.value.backgroundColor='purple'
}
ispink.value=!ispink.value;
}

</script>
<template>
<input type="button" value="点击有惊喜"  @click="mouseClick()" :style="buttonStyle">

</template>
